import request from '@/config/axios'

export interface StipendVO {
  id: number
  major: number
  studentNumber: number
  studentName: string
  stipendCategory: string
  stipendName: string
  level: string
  awardingAuthority: string
  awardDate: undefined
  remark: string
  status: number
  reason: string
}

// 查询助学金信息列表
export const getStipendPage = async (params) => {
  return await request.get({ url: `/data/stipend/page`, params })
}

// 查询助学金信息详情
export const getStipend = async (id: number) => {
  return await request.get({ url: `/data/stipend/get?id=` + id })
}

// 新增助学金信息
export const createStipend = async (data: StipendVO) => {
  return await request.post({ url: `/data/stipend/create`, data })
}

// 修改助学金信息
export const updateStipend = async (data: StipendVO) => {
  return await request.put({ url: `/data/stipend/update`, data })
}

// 修改助学金信息
export const updateStipendStatus = async (data: StipendVO) => {
  return await request.put({ url: `/data/stipend/updateStatus`, data })
}

// 删除助学金信息
export const deleteStipend = async (id: number) => {
  return await request.delete({ url: `/data/stipend/delete?id=` + id })
}

// 导出助学金信息 Excel
export const exportStipend = async (params) => {
  return await request.download({ url: `/data/stipend/export-excel`, params })
}
